package cn.com.inossem.utils;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.util.Log;

/**
 * 堆栈控制
 * 
 * @author wuyt3
 * 
 */
public class ActivityStackControlUtil {
	private static List<Activity> activityList = new ArrayList<Activity>();
	private static String TAG = "ActivityStackControlUtil";

	public static void remove(Activity activity) {

		activityList.remove(activity);

	}

	public static void add(Activity activity) {

		activityList.add(activity);

	}

	public static void exitApp() {

		for (Activity activity : activityList) {
			Log.i(TAG, "-------------------------");
			System.out.println(activity.getLocalClassName());
			activity.finish();

		}
		activityList.clear();
		android.os.Process.killProcess(android.os.Process.myPid());

	}
}
